
<?php
	require_once(dirname(__FILE__)."/lib/mysql.php");
	
	$_PARA 	= array() ;
	if(array_key_exists('item_id',$_POST))	$_PARA 		= $_POST ;
	else									$_PARA 		= $_GET ;

	$item_id     = intval($_PARA['item_id']);
	if ($item_id == 0){
		echo "error no item_id ." ;
		exit(0) ;
	}
	
	sql_connect();
	$item = sql_fetch_one("select * from sys_item where `id` = $item_id") ;
	if (is_array($item) == false || array_key_exists("id", $item) == false){
		echo "error item_id not find." ;
		exit(0) ;
	}
	
	echo "品名 : " . $item['name'] ;
	if (strlen($item['gjj_code']) > 0){
		echo "<br>过++编码 : " . $item['gjj_code'] ;
	}
	if (intval($item['brand_id']) > 0){
		echo "<br>品牌 : " . sql_fetch_one_cell("select `name` from grp_brand where `id` = '{$item['brand_id']}'") ;
	}
	$sery = sql_fetch_rows("select g.`name` from sys_item_sery s left join grp_sery g on s.sery_id = g.`id` where s.`item_id` = '{$item['id']}'") ;
	if (count($sery) > 0){
		echo "<br>系列 : " ;
		$dh = "" ;
		foreach ($sery as $s){
			echo $dh.$s['name'] ;
			$dh = "," ;
		} 
	}
	$style = sql_fetch_rows("select g.`name` from sys_item_style s left join grp_style g on s.style_id = g.`id` where s.`item_id` = '{$item['id']}'") ;
	if (count($style) > 0){
		echo "<br>风格 : " ;
		$dh = "" ;
		foreach ($style as $s){
			echo $dh.$s['name'] ;
			$dh = "," ;
		} 
	}
	$color = sql_fetch_rows("select g.`name` from sys_item_color s left join grp_color g on s.color_id = g.`id` where s.`item_id` = '{$item['id']}'") ;
	if (count($color) > 0){
		echo "<br>色系 : " ;
		$dh = "" ;
		foreach ($color as $s){
			echo $dh.$s['name'] ;
			$dh = "," ;
		} 
	}
	if (strlen($item['size']) > 0){
		echo "<br>规格 : " . $item['size'] ;
	}
	$place = sql_fetch_rows("select g.`name` from sys_item_place s left join grp_place g on s.place_id = g.`id` where s.`item_id` = '{$item['id']}'") ;
	if (count($place) > 0){
		echo "<br>产地 : " ;
		$dh = "" ;
		foreach ($place as $s){
			echo $dh.$s['name'] ;
			$dh = "," ;
		} 
	}
	if (strlen($item['size']) > 0){
		echo "<br>规格 : " . $item['size'] ;
	}
	if (strlen($item['volume']) > 0){
		echo "<br>体积 : " . $item['volume'] ;
	}
	if (strlen($item['package']) > 0){
		echo "<br>包装件数 : " . $item['package'] ;
	}
	if (strlen($item['tips']) > 0){
		echo "<br>描述 : " . $item['tips'] ;
	}
	
?>

<html lang="en">
    <head scroll="no" style="overflow-x:hidden">
   		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
   	</head>
</html>
